package com.example.scan2;

import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.util.Log;

import com.example.KeHuDuan.R;
import com.google.zxing.Result;
import com.google.zxing.activity.CaptureActivity;

public class Scan extends CaptureActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_scanner);

    }

    @Override
    public void handleDecode(Result result, Bitmap barcode) {
        super.handleDecode(result, barcode);

        String resultString = result.getText();
        Log.d("扫描结果", "handleDecode: "+resultString);
        Intent intent = new Intent();
        intent.putExtra(Constant.INTENT_EXTRA_KEY_QR_SCAN, resultString);
        setResult(RESULT_OK, intent);
    }
}
